(function(){
    let info=document.querySelector('.info')
    fetch("http://chst.vip:1234/api/getinlanddiscount")
        .then(body => body.json())
        .then(res => {
             console.log(res)
             let domStr=''
            res.result.forEach(item => {
        //    let regExp = /(?<=imgurl=)[^'"]*/
        //     let result = item.productImg.match(regExp)
        //     console.log(result);
             domStr+=`
             <li>
                <a href="">
                    <div class="image">
                       ${item.productImg}
                    </div>
                    <div class="title">${item.productName}</div>
                    <p class="price">${item.productPrice}</p>
                    <p class="from">${item.productTime}</p>
                </a>
            </li>`
            })
            info.innerHTML=domStr
    
    
           
          
        })
})()